<?php
use yii\db\Schema;
use yii\db\Migration;

/**
 * 文章表
 *
 * @author jois
 */
class m150909_051628_create_articles_table extends Migration
{

    public function up()
    {
        $this->createTable('articles', [
            'id' => Schema::TYPE_PK,
            'game_id' => Schema::TYPE_INTEGER,
            'title' => Schema::TYPE_STRING . ' NOT NULL',
            'content' => Schema::TYPE_TEXT,
            'logo_path' => Schema::TYPE_STRING . ' NOT NULL default \'\'',
            'kind' => Schema::TYPE_SMALLINT . ' default 1',
            'author' => Schema::TYPE_STRING . ' NOT NULL default \'\'',
            'sort' => Schema::TYPE_INTEGER . ' default 0',
            'created_at' => Schema::TYPE_INTEGER . ' NOT NULL',
            'updated_at' => Schema::TYPE_INTEGER . ' NOT NULL'
        ]);
    }

    public function down()
    {
        $this->dropTable('articles');
    }
}
